package com.dhcc.bpm.modules.sandbox.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dhcc.bpm.modules.sandbox.entity.SandboxApi;
import com.dhcc.bpm.modules.sandbox.mapper.SandboxApiMapper;
import com.dhcc.bpm.modules.sandbox.service.ISandboxApiService;
import com.dhcc.bpm.modules.sandbox.vo.SandboxApiVO;
import org.springframework.stereotype.Service;

/**
 * @ClassName SandboxApiServiceImpl
 * @Description 沙箱实例表 服务实现类
 * @Author sjm
 * @Date 2020/2/21 0021 15:16
 * @Version V1.0
 * @Copyright: 2020 东华软件 . All rights reserved.
 **/
@Service
public class SandboxApiServiceImpl extends ServiceImpl<SandboxApiMapper, SandboxApi> implements ISandboxApiService {

	/**
	 * 自定义分页
	 * @Author sjm
	 * @Date 18:17 2020/2/21 0021
	 * @param page
	 * @param sandboxApi
	 * @return com.baomidou.mybatisplus.core.metadata.IPage<com.dhcc.bpm.modules.sandbox.vo.SandboxApiVO>
	 **/
	@Override
	public IPage<SandboxApiVO> selectSandboxApiPage(IPage<SandboxApiVO> page, SandboxApiVO sandboxApi) {
		return page.setRecords(baseMapper.selectSandboxApiPage(page, sandboxApi));
	}

	/**
	 * 查询沙箱接口集合
	 * @Author sjm
	 * @Date 18:18 2020/2/21 0021
	 * @param caseId
	 * @param api
	 * @return com.dhcc.bpm.modules.sandbox.vo.SandboxApiVO
	 **/
	@Override
	public SandboxApiVO selectSandboxApiList(Long caseId, Long api) {
		return baseMapper.selectSandboxApiList(caseId, api);
	}

	@Override
	public int deleteByCaseId(Long caseId) {
		return baseMapper.deleteByCaseId(caseId);
	}

}
